package com.fantabest.common.server;

import java.util.List;

import com.fantabest.common.client.TeamService;
import com.fantabest.common.entity.Manager;
import com.fantabest.common.entity.Player;
import com.fantabest.common.entity.Season;
import com.fantabest.common.entity.Team;
import com.fantabest.common.server.dao.TeamDao;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class TeamServiceImpl extends RemoteServiceServlet implements
		TeamService {

	public Team findByManager(Manager manager, Season season) {
		return TeamDao.getInstance().findByManager(manager, season);
	}

	public void save(Team team) {
		TeamDao.getInstance().save(team);
	}

	public List<Player> findPlayers(Manager manager, Season season) {
		return TeamDao.getInstance().findByManager(manager, season).getPlayers();
	}

}
